from django.contrib import admin

# Register your models here.
from django.contrib import admin
from .models import *

# 注册模型
admin.site.register(Category)
admin.site.register(Post)
admin.site.register(Student)
admin.site.register(Application)
admin.site.register(Product)
# admin.site.register(Cart)
admin.site.register(CartItem)
admin.site.register(Order)
admin.site.register(OrderItem)
admin.site.register(Comment)
admin.site.register(PostImage)
admin.site.register(CommentLike)
admin.site.register(PostLike)
admin.site.register(Contact)
admin.site.register(ChatMessage)
admin.site.register(Report)
admin.site.register(ProductImage)
admin.site.register(Notification)
admin.site.register(Proofs)
# admin.site.register(Report)


class CartItemInline(admin.TabularInline):
    model = CartItem
    extra = 1  # 以增加新的一行


@admin.register(Cart)
class CartAdmin(admin.ModelAdmin):
    inlines = [CartItemInline]
